﻿@model XPressify.Models.AlbumCreateFinishModel

@using XPressify.Data.Helpers

@{
    ViewBag.Title = "Album create";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Album create</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Fields</legend>
        <table>
            <tr>
                <th>Name</th>
                <th>Description</th>
                <th>Size</th>
                <th></th>
                <th></th>
            </tr>
            
            @{
                var index = 0;
                foreach (var File in Model.UploadedFiles)
                { 
                    <tr>
                        <td>
                            @Html.TextBoxFor(model => model.UploadedFiles[index].Name)
                        </td>
                        <td>
                            @Html.TextAreaFor(model => model.UploadedFiles[index].Description, 6, 22, new { style = "resize: none;" })
                        </td>
                        <td>
                            @Html.DisplayFor(model => model.UploadedFiles[index].Size)
                        </td>
                        <td>
                        @if(File.MediaType == MediaType.Photo)
                        {
                            <img src="@File.Path" alt="@File.Name" title="@File.Name" style="width: 100px; height: 100px;" />
                        }
                        </td>
                        <td>
                            @Html.HiddenFor(model => model.UploadedFiles[index].Id)
                        </td>
                    </tr>
                    <tr>
                        <th>
                        </th>
                        <th>
                        </th>
                        <th>
                        </th>
                        <th>
                        </th>
                     </tr>   
                       index++;
                }
            }

        </table>
        <p>
            <input type="submit" value="Finish" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "AlbumOwnerList")
</div>

